﻿using System;
using System.Collections.Generic;
using System.Linq.Expressions;

namespace Wamm.ApplicationExceptions {
    public class RuleViolationFor<TModel> {
        public IList<RuleViolation> Errors { get; private set; }

        public RuleViolationFor(IList<RuleViolation> errors) {
            Errors = errors;
        }

        public void ErrorFor<TProperty>(Expression<Func<TModel, TProperty>> property, string message) {
            Errors.Add(new RuleViolation { Property = property, Message = message });
        } 
    }

}